package com.waymap.mapper;


import com.waymap.domain.Locations;
import com.waymap.domain.User;
import com.waymap.utils.MyMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created by tim on 2018/7/18.
 */
@Mapper
public interface UserMapper extends MyMapper<User> {
    List<Map> getLocList(String available);

    Map getUserInfo(User user);

    /**
     * 通过用户名查询用户信息
     * @Param("username")
     * @return
     */
    User getUserInfoByUserName(@Param("userName")String userName);

    User getUserInfoByToken(@Param("token") String token);

    /**
     * 登陆成功,更新token
     * @param userName
     * @param token
     * @return
     */
    int updateUserToken(@Param("userName") String userName, @Param("token")String token);
    
    /**
     * 查询同一account下user name是否存在
     * @param userInfo
     * @return
     */
    List<Map> checkUserExist(Map userInfo);
}
